<include file="Public:header" />
<div class="container"> 
  <div class="mainbody">
  <include file="Public:scoreMenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>创建/编辑商品</h2>
      </div>
      <div class="detail-tab">
          <form name="form1"  enctype="multipart/form-data" method="post" action="__URL__/doProduct" role="form" >
          <div class="form-group">
            <label for="name">商品名<i>*</i></label>
            <input type="text" name="title" class="searcheTxt"  id="name" placeholder="" value="{$data.title}">
          </div>
          <div class="form-group">
            <label for="name">消耗积分<i>*</i></label>
            <input type="text" name="score" class="searcheTxt"  id="name" placeholder="" value="{$data.score}">
          </div>
		   <div class="form-group">
            <label for="name">支付价格<i>*</i></label>
            <input type="text" name="price" class="searcheTxt"  id="name" placeholder=""  value="{$data.price}">
          </div>
		  <div class="form-group">
            <label for="p_stint">是否打折</label>
            <input type="checkbox" value="1"  name="issale" <if condition="$data.issale eq 1">checked="checked"</if>>
             <p class="help-block formRemind" style="margin-left:150px; margin-top:-15px;" >勾选前台自动进行折扣计算，银卡7折，金卡6折，钻石卡5折</p>
          </div>
          
          <div class="form-group ">
            <label for="IbtnEnter"></label>
            <button type="button"  id="IbtnEnter" class="btn btn-primary "><span class="glyphicon glyphicon-floppy-saved"></span> 保 存 </button>
          </div>
			<input type="hidden" name="id" value="{$data.id}">
			<?php  if($_GET['sid']){?>
				<input type="hidden" name="sid" value="<?php echo $_GET['sid'];?>">
			<?php }else{?>
				<input type="hidden" name="sid" value="<?php echo $data['sid'];?>">
			<?php }?>
          </form>
      </div>
    </div>
  </div>
</div>

<style type="text/css">
 .img{  width: 110px; height: 160px;}
 .img2{ width: 240px; height: 165px;}
</style>

<include file="Public:footer" /> 
<script type="text/javascript">

$(function(){

	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
});

function saveActivity() {
    var state = true;
    if ($("#name").attr("value") == "") {
        alert("请输入姓名！");
        state = false;
        $("#name").focus();
        return false
    }
    
    if (state) {
       $("form").submit();
		//commonAjaxSubmit("__URL__/saveAddAvtivity","{$_REQUEST['id']}");
    }
};
</script>